package main

import (
	"database/sql"
	"database/sql/driver"
	_ "github.com/go-sql-driver/mysql"
  "log"
)

var db driver.Conn

//链接数据库的
func InitDb() error {
	//username:password@protocol(address)/dbname?param=value
	db, err := sql.Open("mysql", "root:root@tcp(127.0.0.1:3306)/istore2")

	return err
}

func main() {
  err := InitDb();

  if err != nil {
    log.Println("db err:",err)
  }

  
}
